package com.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBManager {
	private static Connection con = null;

	private DBManager() {

	}

	public synchronized static Connection getConnection() {
		if (con == null) {
			try {

				Class.forName(Config.DRIVER);
				con = DriverManager.getConnection(Config.URL, Config.NAME,
						Config.PASSWORD);

			} catch (ClassNotFoundException e) {
				e.printStackTrace();
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		return con;

	}

}
